<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>
<style type="text/css">
body,td,th {
	color: #00C;
	font-weight: bold;
}
body {
	background-color: #D6D6D6;
}
h1 {
	color: #FFF;
}
</style>
</head>

<body>
<?php

	$db = mysql_connect("localhost", "root", "");
	if(!$db)
	{
		echo "Không thể kết nối csdl";
		exit;
	}
	mysql_select_db("quangcaosp");
	
	$result = mysql_query("SELECT * FROM loaisp");
	
	if(mysql_num_rows($result) <>0)
	{
	
		echo "<table width='500' border='1' align='center'>";
		  echo "<tr>";
			echo "<td colspan='2' align='center' bgcolor='#0066FF'><h1><em>Danh Sách Loại Hàng</em></h1></td>";
		  echo "</tr>";
		  echo "<tr>";
			echo "<td width='200' align='center' bgcolor='#CCCCCC'>Mã Loại Hàng</td>";
			echo "<td width='300' align='center' bgcolor='#CCCCCC'>Tên Loại Hàng</td>";
		  echo "</tr>";
		  while ($row = mysql_fetch_row($result))
		  {
			 
		  	$MaLoaiSP = $row[0];
			$TenLoaiSP = $row[1];
			  echo "<tr>";
				echo "<td bgcolor='#CCCCCC'>$MaLoaiSP</td>";
				echo "<td bgcolor='#CCCCCC'>$TenLoaiSP</td>";
			  echo "</tr>";
			 // echo "<tr>";
				//echo "<td colspan='2' bgcolor='#CCCCCC'>&nbsp;</td>";
			 // echo "</tr>";
		  }
		echo "</table>";
	}
?>
</body>
</html>